package com.skiving.cloud.common.utils;

import org.noear.solon.vault.VaultCoder;
import org.noear.solon.vault.coder.AesVaultCoder;

public class VaultUtil {
    public static void main(String[] args) throws Exception{
        String salt = "beRzjdzNkiBP3juM";
        String vaultSource = "123456";
        String vaultResult = "";
        VaultCoder guardCoder = new AesVaultCoder(salt);
        vaultResult = guardCoder.encrypt(vaultSource);
        //打印生成的密文
        System.out.println("ENC(" + vaultResult + ")");
        //打印生成的密文
        System.out.println(guardCoder.decrypt(vaultResult));
    }
}
